<template>
	<gui-page ref="guiPage" :customHeader="true">
		<template v-slot:gHeader>
			<nav-bar-custom left-icon="left" :title="$t('distributedEnter.scanRecord')"></nav-bar-custom>
		</template>
		<template v-slot:gBody>
			<view v-if="data.iqcOutScanListOther.length==0" class="noticeHooks">
				{{data.iqcOutScanListOther.length == 0 ? $t('stockManage.notAvailable') : $t('stockManage.without')}}
			</view>
			<view class="record-card" v-for="(item, index) in data.iqcOutScanListOther" :key="`${item.barcode}` + `${index}`" v-else>
				<view class="card-mini-head">
					<view class="title-line"></view>
					<text>{{$t('translationImage.serialNumber')}}：{{data.iqcOutScanListOther.length-index}}</text>
				</view>
				<uni-icons class="close-icons" type="closeempty" color="#9C9C9C" size="30"
					@click="handelClosePopup(index,item)"></uni-icons>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('hardwareOut.materialsDepartment')}}：</text>{{ item.department }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('materials.expenseItem')}}：</text>{{ item.costItem }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('materials.remark')}}：</text>{{ item.remark }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('distributedOut.barcode')}}：</text>{{ item.barcode }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('distributedEnter.materialCode')}}：</text>{{ item.materialCode }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('distributedEnter.materialName')}}：</text>{{ item.materialName }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('distributedEnter.materialSpec')}}：</text>{{ item.materialSpec || '' }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('distributedEnter.uom')}}：</text>{{ item.unit }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('distributedEnter.qty')}}：</text>{{ item.currentQty }}
				</view>
				<view class="custom-card-itemOne">
					<text class="item-info-title">{{$t('hardwareOut.outQty')}}：</text>{{ item.inputNum }}
				</view>
			</view>
		</template>
	</gui-page>
</template>

<script setup>
import { navigate } from '@/utils/routerSkip.js';
import { useStore } from "vuex";
import { basPdaOperationLogFn } from '@/utils/index.js';
import { OPERATION_DEL, OPERATION_LOOK } from '@/constant/index.js'
import {computed,reactive,onMounted} from 'vue';

onMounted(() => {
	// console.log(data.iqcOutScanListOther)
	// try {
	// 	let inputParameter = '无'
	// 	let returnParameter = JSON.stringify(data.iqcOutScanList2)
	// 	let operationPicture = '质检其他出库'
	// 	let callInterface = '无'
	// 	let opertionParmes = {
	// 		inputParameter,
	// 		returnParameter,
	// 		operationPicture,
	// 		callInterface,
	// 		responseCode:'无',//返回状态
	// 		errorMessage:'无',//错误信息
	// 		isPass:'Y',//是否成功 Y N
	// 		operationType:OPERATION_LOOK
	// 	}
	// 	basPdaOperationLogFn(opertionParmes)
	// } catch (error) {
	// }
})
let data = reactive({
	iqcOutScanListOther: [],
})
let store = useStore();
// fqc扫描条码
data.iqcOutScanListOther = computed(() => {
	console.log(store.state.hardWare.iqcOutScanListOther)
	return store.state.hardWare.iqcOutScanListOther
})
const handelClosePopup = (index,item) => {
	try {
		let inputParameter = JSON.stringify(item)
		let returnParameter = '无'
		let operationPicture = '粉碎简单生产退料'
		let callInterface = '无'
		let opertionParmes = {
			inputParameter,
			returnParameter,
			operationPicture,
			callInterface,
			responseCode:'无',//返回状态
			errorMessage:'无',//错误信息
			isPass:'Y',//是否成功 Y N
			operationType:OPERATION_DEL
		}
		basPdaOperationLogFn(opertionParmes)
	} catch (error) {
	}
	console.log(index)
	//edit by xyz  修复质检其他出库无法删除扫描记录的bug
    store.dispatch('hardWare/delIqcOutSpScanListItemOther',index)
}
</script>

<style>
</style>
